<link href="<?php echo base_url('resources')?>/css/admin/styles.css" rel="stylesheet" type="text/css" />
<?php
//include('includes/leftStaffPanel.php');
?>
<div id="PeopleTableContainer">
<div id="TableContainer"></div>
<div> <br /></div>
<div class="addRecord">
    <form name="addEvent" action="<?php echo base_url('admin/event/editEvent'); ?>" method="post" enctype="multipart/form-data">
        <input type="submit" value="Thêm Sự Kiện" />
    </form>
</div>
</div>

	<script type="text/javascript">

		$(document).ready(function () {

		    //Prepare jTable
			$('#TableContainer').jtable({
				title: 'Danh sách chức danh',
				paging: true,
                pageSize: 15,
                pageSizeChangeArea: false,
                sorting: true,
                defaultSorting: 'MaSuKien DESC',
                actions: {
					listAction: '<?php echo base_url('admin/event/getListEvent'); ?>',
                    deleteAction: '<?php echo base_url('admin/event/deleteEvent'); ?>',
                    
				},
				fields: {
					MaSuKien:{
                        key: true,
                        list: true,
						title:'Mã Sự Kiện',
                        width:'10%',
                        display: function(data) {
                            var $link = $('<a href="<?php echo base_url('admin/event/editEvent?eventId='); ?>' + data.record.MaSuKien + '" style="text-decoration: none;">' + data.record.MaSuKien + '</a>');
                            return $link;
                        }
                        
					},
					TieuDe:{
						title: 'Tiêu Đề',
                        width: '30%',
                        display: function(data) {
                            var $link = $('<a href="<?php echo base_url('admin/event/editEvent?eventId='); ?>' + data.record.MaSuKien + '" style="text-decoration: none;">' + data.record.TieuDe + '</a>');
                            return $link;
                        }
                        
					},
                    MoTa:{
						title: 'Tóm Tắt',
                        width: '60%',
                        
					}
				}
                
			});

			//Load person list from server
			$('#TableContainer').jtable('load');

		});
        
        

	</script>